Skip to content

Add provisional iPhone 18, iPhone Duo, and 2026 Apple Watch support - #507

Open
Zandor300 wants to merge 1 commit into
masterfrom
t3code/add-new-apple-device-support
Open

Zandor300 wants to merge 1 commit into
masterfrom
t3code/add-new-apple-device-support

Conversation

@Zandor300

Copy link
Copy Markdown
Member

DeviceKit currently lacks cases for iPhone 18 Pro, iPhone 18 Pro Max, iPhone Duo, Apple Watch Series 12, and Apple Watch Ultra 4. Add provisional entries for these models (including 42mm and 46mm Series 12 variants), using A20 Pro for the iPhones and S11 for the watches. Add isFoldable, true only for iPhone Duo and its simulator, and regenerate the Swift source.

Hardware identifiers remain unconfirmed: entries use placeholder:<caseName>, so automatic detection requires replacing them with confirmed identifiers. Images are omitted, and the generator skips empty image documentation. Display metrics return unknown values (-1 for diagonal/ratio and nil for PPI). Pro and Watch capabilities and Series 12 sizes provisionally follow their predecessors; unconfirmed Duo capabilities use false/empty defaults. These assumptions are documented for verification before release.

Validation:

  • iOS 26.2 simulator tests passed on iPhone 17 Pro.
  • watchOS 26.2 simulator tests passed on Apple Watch Series 11 (46mm).
  • swift test passed on macOS.
  • Generated-source reproducibility, unique identifiers, device-family membership, and git diff --check passed.
  • SwiftLint reports the existing cyclomatic-complexity error in mapToDevice; the same rule fails on the unchanged baseline (140 branches versus 146 with the new entries).

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
8 Warnings
⚠️ Source/Device.generated.swift#L586 - Function should have complexity 10 or less: currently complexity equals 146
cyclomatic_complexity Device.generated.swift:586
⚠️ Source/Device.generated.swift#L743 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:743
⚠️ Source/Device.generated.swift#L1359 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1359
⚠️ Source/Device.generated.swift#L1636 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1636
⚠️ Source/Device.generated.swift#L1827 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1827
⚠️ Source/Device.generated.swift#L1998 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:1998
⚠️ Source/Device.generated.swift#L2729 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:2729
⚠️ Source/Device.generated.swift#L2793 - TODOs should be resolved (Replace with proper implementa…).
todo Device.generated.swift:2793

SwiftLint found issues

Warnings

File Line Reason
Device.generated.swift 743 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1359 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1636 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1827 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 1998 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 2729 TODOs should be resolved (Replace with proper implementa...). (todo)
Device.generated.swift 2793 TODOs should be resolved (Replace with proper implementa...). (todo)

Errors

File Line Reason
Device.generated.swift 586 Function should have complexity 10 or less: currently complexity equals 146 (cyclomatic_complexity)

Generated by 🚫 Danger

@Zandor300
Zandor300 force-pushed the t3code/add-new-apple-device-support branch from fbd9281 to b01a580 Compare September 9, 2026 21:08
@Zandor300
Zandor300 force-pushed the t3code/add-new-apple-device-support branch from b01a580 to fe2c427 Compare September 10, 2026 08:13
@mlbonniec

Copy link
Copy Markdown

Hi, any news on this PR ?

@beforeold

Copy link
Copy Markdown

Grabbed the identifiers off the simulators, in case that helps with the placeholders:

Device Identifier Runtime
iPhone 18 Pro iPhone19,2 iOS 27.0 (24A434)
iPhone 18 Pro Max iPhone19,3 iOS 27.0 (24A434)
iPhone Duo iPhone19,4 iOS 27.1 beta (24A94401)

(xcrun simctl getenv <udid> SIMULATOR_MODEL_IDENTIFIER, Xcode 26.4)

Since mapToDevice reads SIMULATOR_MODEL_IDENTIFIER for simulators, those are the exact strings it gets. Right now a Duo sim lands in .unknown("iPhone19,4").

Display specs off Apple's page:

Screen Diagonal Resolution ppi
Outer 5.4" 1398 x 2034 460
Inner 7.6" 1878 x 2670 430

Ratios come out to 233:339 and 313:445.

One gotcha if you read these from the simulator instead: it reports the inner screen as {2007, 2853} @3x, but that's the render buffer, downsampled to the 1878x2670 panel. Same as the 6/7/8 Plus, where DeviceKit uses 5.5"/401ppi rather than the 2208x1242 buffer. Outer screen is fine, the sim matches the specs there.

The two screens have different ppi though (460 vs 430), and there's only one ppi/diagonal/ratio per device. Not sure which way you'd want to go there - inner, outer, or new fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants